package com.gitee.sidihuo.sse;

import com.gitee.sidihuo.sse.base.SseHttpResponseFunction;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import java.util.List;
import java.util.concurrent.CountDownLatch;

/**
 *  流式okhttp3请求参数封装
 */
public class SseOkHttpPara<T> {
    /**
     * 一次http请求会话id
     */
    private String id;

    /**
     * 流式http请求响应对象
     */
    private SseEmitter sseEmitter;

    private CountDownLatch countDownLatch;

    private List<T> streamResults;

    private List<String> streamOriginResults;

    private SseHttpResponseFunction<T> sseHttpResponseFunction;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public SseEmitter getSseEmitter() {
        return sseEmitter;
    }

    public void setSseEmitter(SseEmitter sseEmitter) {
        this.sseEmitter = sseEmitter;
    }

    public CountDownLatch getCountDownLatch() {
        return countDownLatch;
    }

    public void setCountDownLatch(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    public List<T> getStreamResults() {
        return streamResults;
    }

    public void setStreamResults(List<T> streamResults) {
        this.streamResults = streamResults;
    }

    public SseHttpResponseFunction<T> getSseHttpResponseFunction() {
        return sseHttpResponseFunction;
    }

    public void setSseHttpResponseFunction(SseHttpResponseFunction<T> sseHttpResponseFunction) {
        this.sseHttpResponseFunction = sseHttpResponseFunction;
    }

    public List<String> getStreamOriginResults() {
        return streamOriginResults;
    }

    public void setStreamOriginResults(List<String> streamOriginResults) {
        this.streamOriginResults = streamOriginResults;
    }
}
